// const ip = 'http://172.31.119.68:9001'
const ip = 'https://szzc-sit.test.cgbchina.com.cn:7571'
// const ip = 'https://wxmessage.syswinsoft.com'
// const ip = 'https://console.wuyetoon.com'; // 演示环境

module.exports = {
  // 这里是配置上线读取当前目录，默认是根路径，如 /js, /css 等，具体根据项目来
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  productionSourceMap: false,
  parallel: false,
  pages: {
    index: {
      entry: 'src/main.js',
      template: 'public/index.html',
      filename: 'index.html'
    }
    // 可以添加两个入口
    // invoicing: {
    //   entry: 'src/rentMain.js',
    //   template: 'public/rent.html',
    //   filename: 'rent.html'
    // }
  },
  devServer: {
    port: 7074,
    proxy: {
      '/qiniu': {
        target: 'http://172.31.119.68:35005/qiniu',
        changeOrigin: true,
        pathRewrite: {
          '^/qiniu': ''
        }
      },
      '/basedata': {
        target: `${ip}/basedata`,
        changeOrigin: true,
        pathRewrite: {
          '^/basedata': ''
        }
      },
      '/organization': {
        target: `${ip}/organization`,
        changeOrigin: true,
        pathRewrite: {
          '^/organization': ''
        }
      },
      '/open': {
        // 获取token
        target: `${ip}/open`,
        changeOrigin: true,
        pathRewrite: {
          '^/open': ''
        }
      },
      '/propertymanagementweb': {
        // 获取token
        target: `${ip}/propertymanagementweb`,
        changeOrigin: true,
        pathRewrite: {
          '^/propertymanagementweb': ''
        }
      },
      '/accessweb': {
        // 权限接口
        target: `${ip}/accessweb`,
        changeOrigin: true,
        pathRewrite: {
          '^/accessweb': ''
        }
      },
      '/usermanager': {
        // 权限接口
        target: `${ip}/usermanager`,
        changeOrigin: true,
        pathRewrite: {
          '^/usermanager': ''
        }
      },
      '/message': {
        target: `${ip}/message`,
        changeOrigin: true,
        pathRewrite: {
          '^/message': ''
        }
      }
    }
  },
  css: {
    requireModuleExtension: true,
    sourceMap: false,
    loaderOptions: {
      less: {}
    }
  },
  lintOnSave: false
}
